#ifndef LOADER_H
#define LOADER_H

#include <QFrame>

class QFtp;

namespace Ui {
    class Loader;
}

class Loader : public QFrame
{
    Q_OBJECT
public:
    explicit Loader(QWidget *parent = 0);
    ~Loader();

private:
    void setStatusLabelText(QString text);
    void setErrorLabelText(QString text);
    void uploadFile();

signals:
    void noDroneConnection();
    void droneConnected(QString version);

private slots:
    void handleLoaderTimer();
    void lookUpHost();
    void readDroneFtp();
    void droneConnectionTimeout();
    void on_pushButtonExit_clicked();

private:
    Ui::Loader *ui;
    QTimer *mLoaderTimer;
    int mLoadDots;
    QFtp *mFtp;
    QString mVersion;
    bool mConnectedToDrone;
    uint mConnectState;
};

#endif // LOADER_H
